﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace WebberCross.Obelisk
{
    public class NavigationManager : IPersistent
    {
        private Frame _mainFrame = null;

        [Persist]
        public string State
        {
            get
            {
                if (this._mainFrame != null)
                    return this._mainFrame.GetNavigationState();

                return null;
            }
            set
            {
                if (value != null && this._mainFrame != null)
                    this._mainFrame.SetNavigationState(value);
            }
        }

        public NavigationManager(Frame mainFrame)
        {
            _mainFrame = mainFrame;
        }

        public void OnLaunched()
        {

        }

        public void OnActivated(bool preserved)
        {

        }

        public void OnDeactivated()
        {

        }

        public void OnClosing()
        {

        }
    }
}
